package com.feidee.bigdata.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author:CHQ
 * @Date:2020/4/23 14:22
 * @Description
 */
@ComponentScan
@EnableBinding(Sink.class)
public class ConsumerController {

    @Value("${service.port}")
    String port;

    @StreamListener(Sink.INPUT)
    public void recive(Message<String> message) {
        System.out.println("我是消费者1号-------》消费到了：" + message.getPayload() + "---------》消费端口：" + port);
    }
}
